<?php
class PNCategories extends PNObject {
  function PNCategories($init=null, $where='')
  {
    $this->PNObject();

    $this->_objType       = 'ishopstore_categories';
    $this->_objField      = 'id';
    $this->_objPath       = 'form';

    $this->_init($init, $where);
  }

    ///////////////////////// POST PROCESS ///////////////////////////
  function insertPostProcess(){
    Loader::loadClass('DataUtilEx', "modules/IShopStore/pnincludes");
    $id = DBUtil::getInsertID ($this->_objType, $this->_objField);
    if ($id){
      $object = array('id'=>$id);
      DBUtil::updateObject($object,$this->_objType);

    }
  }

  function deletePreProcess(){
    $id = $this->_objData['id'];
    if ($id){
      //delete files
      DBUtil::deleteWhere('ishopstore_categories',"WHERE ctg_id = '$id'");
    }
  }


}